﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NHibernate.Criterion;

namespace NewsDemo.Data
{
    public partial class EditorDao
    {
        public Editor FindByNameAndPassword(string username, string password)
        {
            return Session.CreateCriteria(typeof(Editor))
                .Add(Expression.Like("Username", username))
                .Add(Expression.Like("Password", password))
                .Add(Expression.Eq("Status", 0))
                .Add(Expression.Eq("Deleted", false))
                .UniqueResult<Editor>();
        }
    }
}
